<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
	<s:include value="%{getText('app.includes.head')}" />
	
	<SCRIPT type="text/javascript">
		window.name = "tokenMain";
	</SCRIPT>
</head>

<body>
	<s:include value="%{getText('app.includes.body_header')}" />

	<p>
	Use this tool to authenticate using token-based Delegated Authentication. To view the state of the Token Store through out this process, see the <a href="DisplayTokenStore.action" target="tokenViewer">Token Store Viewer</a>. Note, in a production environment, the Token Store would <em>never</em> be exposed, but it is displayed here for demonstration purposes.
	</p>

		<ul>
			<li><span class="mainmenu"><s:text name="label.configure"/></span><br/>
			Ensure Salesforce is configured for Delegated Authentication Single Sign-On with this service:</li>
				<ul>
					<li>Delegated Authentication Single Sign-On must be activated for the organization.</li>
					<li>Enable the <em>Is Single Sign-On Enabled</em> profile permission for the users who should be re-directed to this service.</li>
					<li>
						Go to <em>Setup | Security Controls | Single Sign-On Settings | Delegated authentication</em>
					    and set the <em>Delegated Gateway URL</em> to the following:

						<p style="font-family: monospace,courier;"><s:text name="ServiceEndpoint"/></p>
				    </li>
					
				</ul>
				
			<li><span class="mainmenu"><s:text name="label.generate"/></span><br/>

				<s:form method="POST" action="GenerateToken.action">
				
					<s:textfield label="%{getText('label.delauth.username')}" key="username" size="40"/>
					<s:textfield label="%{getText('label.delauth.instance')}" key="instance" value="www" size="40"/>
					
					<s:if test="startURL!=null">
						<s:textfield label="%{getText('label.startURL')}" key="startURL" size="40"/>
					</s:if>
					
					<s:checkbox label="%{getText('label.isPortalLogin')}" key="portalLogin"/>
													
					<s:submit value="Generate Token"/>
				
				</s:form>			

			</li>
			
			<li><span class="mainmenu"><s:text name="label.login"/></span><br/>
				Using the token credentials generated by the form above, log into Salesforce. <p/>
			</li>

			<li><span class="mainmenu"><s:text name="label.authenticate"/></span><br/>
				The token will be passed back to Axiom from Salesforce for delegated authentication and removed from the Token Store to prevent future use.
			</li>
				
	</ul>

	

			
	<s:include value="%{getText('app.includes.body_footer')}" />
</body>

</html>